package com.ruoyi.web.controller.workJob;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.worker.domain.Company;
import com.ruoyi.worker.domain.Suggest;
import com.ruoyi.worker.mapper.SuggestMapper;
import com.ruoyi.worker.service.SuggestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SuggestController
 * @Description 投诉建议
 * @Author leizhang
 * Date 2021/9/3 4:47 下午
 * @Version 1.0
 **/
@RestController
@RequestMapping("/suggestApi")
public class SuggestController extends BaseController {
    @Autowired
    private SuggestService suggestService;
    @GetMapping("/getSuggestLists")
    public TableDataInfo getCompanyListInfo(Suggest suggest) {
        startPage();
        List<Suggest> companyList = suggestService.getSuggestList(suggest);
        return getDataTable(companyList);
    }

    @Log(title = "渠道管理", businessType = BusinessType.UPDATE)
    @PutMapping("/changeStatus")
    public AjaxResult changeStatus(@RequestBody Map<String, Object> requestParam) {
        return toAjax(suggestService.updateStatus(requestParam));
    }

    @GetMapping("/getImg/{id}")
    public AjaxResult getImg(@PathVariable int id) {
        List<String> imgs = suggestService.getImg(id);
      return   AjaxResult.success("操作成功",imgs);
    }
}
